package graduation.project.body;

public class TestCase {

	private int testData;
	private boolean expectant;
	
	public TestCase(){		
	}
	public TestCase(int testData, boolean expectant){
		this.testData = testData;
		this.expectant = expectant;
	}
	
	public int getTestData(){
		return testData;
	}
	
	public void setTestData(int testData){
		this.testData = testData;
	}
	
	public boolean getExpectantResult(){
		return expectant;
	}
	
	public void setExpectantResult(boolean expectant){
		this.expectant = expectant;
	}
	
	public boolean equals(Object obj){
		if(!(obj instanceof TestCase))
			return false;
		if(obj == null)
			return false;
		
		TestCase tc = (TestCase)obj;
		if(tc.getExpectantResult() == expectant && tc.getTestData() == testData)
			return true;
		return false;
	}
	
	public int hashCode(){
		if(expectant)
			return this.testData * 2;
		else
			return this.testData * (-2);
	}
	
	
	public String toString(){
		return "The test data is " + testData + ", the expectant value is " + expectant + ".";
	}
}
